package day06;

public class MethodDemo {
    public static void main(String[] args) {
        say();
        sayHi("赵又廷");
        sayHello("赵又廷", 95);
    }

    //无参无返回值
    public static void say() {
        System.out.println("HelloWorld!");
    }

    //有参无返回值
    public static void sayHi(String name) {
        System.out.println("大家好，我叫" + name + "，今年38岁了");
    }

    //有参无返回值
    public static void sayHello(String name, int age) {
        if (age >= 80 || age <= 0) {
            System.out.println("年龄不太对吧!");
            return;
        }
        System.out.println("大家好，我叫" + name + "，今年" + age + "岁了");
    }
}
